home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / octa209s.zip / octave-2.09 / libcruft / lapack / zlacpy.f < prev    next >
Text File  |  1996-07-19  |  2KB  |  92 lines

  1.       SUBROUTINE ZLACPY( UPLO, M, N, A, LDA, B, LDB )
  2. *
  3. *  -- LAPACK auxiliary routine (version 2.0) --
  4. *     Univ. of Tennessee, Univ. of California Berkeley, NAG Ltd.,
  5. *     Courant Institute, Argonne National Lab, and Rice University
  6. *     February 29, 1992
  7. *
  8. *     .. Scalar Arguments ..
  9.       CHARACTER          UPLO
  10.       INTEGER            LDA, LDB, M, N
  11. *     ..
  12. *     .. Array Arguments ..
  13.       COMPLEX*16         A( LDA, * ), B( LDB, * )
  14. *     ..
  15. *
  16. *  Purpose
  17. *  =======
  18. *
  19. *  ZLACPY copies all or part of a two-dimensional matrix A to another
  20. *  matrix B.
  21. *
  22. *  Arguments
  23. *  =========
  24. *
  25. *  UPLO    (input) CHARACTER*1
  26. *          Specifies the part of the matrix A to be copied to B.
  27. *          = 'U':      Upper triangular part
  28. *          = 'L':      Lower triangular part
  29. *          Otherwise:  All of the matrix A
  30. *
  31. *  M       (input) INTEGER
  32. *          The number of rows of the matrix A.  M >= 0.
  33. *
  34. *  N       (input) INTEGER
  35. *          The number of columns of the matrix A.  N >= 0.
  36. *
  37. *  A       (input) COMPLEX*16 array, dimension (LDA,N)
  38. *          The m by n matrix A.  If UPLO = 'U', only the upper trapezium
  39. *          is accessed; if UPLO = 'L', only the lower trapezium is
  40. *          accessed.
  41. *
  42. *  LDA     (input) INTEGER
  43. *          The leading dimension of the array A.  LDA >= max(1,M).
  44. *
  45. *  B       (output) COMPLEX*16 array, dimension (LDB,N)
  46. *          On exit, B = A in the locations specified by UPLO.
  47. *
  48. *  LDB     (input) INTEGER
  49. *          The leading dimension of the array B.  LDB >= max(1,M).
  50. *
  51. *  =====================================================================
  52. *
  53. *     .. Local Scalars ..
  54.       INTEGER            I, J
  55. *     ..
  56. *     .. External Functions ..
  57.       LOGICAL            LSAME
  58.       EXTERNAL           LSAME
  59. *     ..
  60. *     .. Intrinsic Functions ..
  61.       INTRINSIC          MIN
  62. *     ..
  63. *     .. Executable Statements ..
  64. *
  65.       IF( LSAME( UPLO, 'U' ) ) THEN
  66.          DO 20 J = 1, N
  67.             DO 10 I = 1, MIN( J, M )
  68.                B( I, J ) = A( I, J )
  69.    10       CONTINUE
  70.    20    CONTINUE
  71. *
  72.       ELSE IF( LSAME( UPLO, 'L' ) ) THEN
  73.          DO 40 J = 1, N
  74.             DO 30 I = J, M
  75.                B( I, J ) = A( I, J )
  76.    30       CONTINUE
  77.    40    CONTINUE
  78. *
  79.       ELSE
  80.          DO 60 J = 1, N
  81.             DO 50 I = 1, M
  82.                B( I, J ) = A( I, J )
  83.    50       CONTINUE
  84.    60    CONTINUE
  85.       END IF
  86. *
  87.       RETURN
  88. *
  89. *     End of ZLACPY
  90. *
  91.       END
  92.